const express = require('express');
const router = express.Router();
const bookController = require('../../controllers/books');


router.post('/getAll', bookController.getAllBooks);       // 获取所有书籍
router.get('/getById', bookController.getBookById);      // 获取单本书籍
router.post('/addBook', bookController.createBook);        // 创建书籍
router.post('/update', bookController.updateBook);        // 更新书籍
router.get('/delete', bookController.deleteBook);        // 删除书籍
router.post('/search', bookController.searchBooks);       // 搜索书籍（扩展操作）

module.exports = router;